/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ws;

import entity.CreditCard;
import javax.jws.WebService;

/**
 *
 * @author Swang
 */
@WebService
public class CardValidator {

    public boolean validate(CreditCard creditCard) {
        Character lastDigit = creditCard.getNumber().charAt(creditCard.getNumber().length() - 1);
        if (Integer.parseInt(lastDigit.toString()) % 2 != 0) {
            return true;
        } else {
            return false;
        }
    }
}
